package com.zjxny.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_erupt.Power;
import xyz.erupt.annotation.sub_erupt.Tree;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.BoolType;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.upms.model.base.HyperModel;

@Setter
@Getter
@Entity
@Table(name = "sms_tpl_info")
@Erupt(
		name = "短信模板信息"
		,tree = @Tree(id = "id", label = "title",pid = "parent.id")
		,power = @Power(
				add = true
				,delete = false 
				,edit = true
				,query = true 
				,importable = false
				,export = false
		)
)
public class SmsTplInfo extends HyperModel{

	private static final long serialVersionUID = 2653779833798950879L;
	@EruptField(
			views = @View(title = "模板编码")
			,edit = @Edit(
					title="模板编码"
					,type = EditType.INPUT
					,notNull = true
				)
	)
	private String code;
	
	@EruptField(
			views = @View(title = "模板名称")
			,edit = @Edit(
					title="模板名称"
					,type = EditType.INPUT
					,notNull = true
				)
	)
	private String title;
	
	
	@EruptField(
			views = @View(title = "模板信息",show = true)
			,edit = @Edit(
					title="模板信息"
					,type = EditType.TEXTAREA
					,notNull = true
				)
	)
	@Column(name = "tpl_content", columnDefinition="text")
	private String tplContent;
	
	@EruptField(
			views = @View(title = "有效")
			, edit = @Edit(
                    title = "有效",
                    type = EditType.BOOLEAN
                    ,search = @Search,
                    boolType = @BoolType
            )
	)
	private Boolean isValid=true;
}